package com.whcoding.test.service;

import com.whcoding.test.pojo.OrmCustomerVO;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface CustomerService {

	/**
	 * 1. Hutool导出
	 * @param ormCustomerVO
	 * @param response
	 * @throws IOException
	 */
	void exportByHutool(OrmCustomerVO ormCustomerVO, HttpServletResponse response) throws IOException;

	/**
	 * 2. easy poi 导出excel
	 * @param response
	 * @throws IOException
	 */
	void exportByEasyPoi(HttpServletResponse response) throws IOException;

	/**
	 * 3. hutool Page 分页查询数据
	 * @param pageable
	 * @return
	 */
	Map<String, Object> queryByHutoolPage(Pageable pageable);

	/**
	 * 4.下载模板
	 *
	 * @param response
	 * @throws IOException
	 */
	void downloadTemplate(HttpServletResponse response) throws IOException;

	/**
	 * 5.JDBC 连接数据库测试
	 */
	void jdbcTemplateTest();



	/**
	 * 2.1. 新增数据
	 *
	 * @param customerVO
	 * @return 影响的行数
	 */
	int saveCustomer(OrmCustomerVO customerVO);

	/**
	 * 2.2 删除数据
	 *
	 * @param id
	 * @return
	 */
	int deleteCustomerId(Long id);


	/**
	 * 2.3 修改数据
	 *
	 * @param id 主键id
	 * @param customerVO
	 * @return
	 */
	int updateCustomer(Long id, OrmCustomerVO customerVO);

	/**
	 * 2.4 根据Id 查询数据
	 *
	 * @param id
	 * @return
	 */
	OrmCustomerVO findCustomerByIds(Long id);

	/**
	 * 2.5 分页查询数据
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	List<OrmCustomerVO> listCustomerByPage(int pageNum, int pageSize);

	/**
	 * 2.6 获取所有的用户
	 * @return
	 */
	List<OrmCustomerVO> getCustomerList();

	/**
	 * 根据客户id 查询数据
	 * @param customerID 客户id
	 * @return
	 */
	OrmCustomerVO getCustomerByID(Integer customerID);
}
